package cn.baiweigang.uu.db.repository;

import cn.baiweigang.uu.db.dataobj.StockInfoDo;
import cn.baiweigang.uu.db.mapper.AnalyseDayInfoMapper;
import cn.baiweigang.uu.enums.StrategyEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class AnalyseDayInfoRepository {

    @Autowired
    private AnalyseDayInfoMapper analyseDayInfoMapper;

    public void delete(String ds, StrategyEnum cl) {
        analyseDayInfoMapper.delete(ds, cl);
    }

    public void insertBatch(List<StockInfoDo> stockInfoDoList) {
        analyseDayInfoMapper.insertBatch(stockInfoDoList);
    }

    public List<StockInfoDo> queryByDsAndCl(String ds, StrategyEnum cl) {
        return analyseDayInfoMapper.queryByDsAndCl(ds, cl);
    }

    public void updatePm(String id, int pm) {
        analyseDayInfoMapper.updatePm(id, pm);
    }

    public List<StockInfoDo> queryOrderByPm(String ds, StrategyEnum  cl) {
        return analyseDayInfoMapper.queryOrderByPm(ds, cl);
    }
}
